<?php
import(APP_DIR.'.templates.themes.themes');

class template_listing extends template_themes
{

	protected function head()
	{
	?>
<!--[if IE]>
<script type="text/javascript" language="javascript" src="../js/excanvas.compiled.js"></script>
<![endif]-->
<script type="text/javascript" language="javascript" src="../js/jquery.bt.min.js"></script>

<link type="text/css" rel="stylesheet" href="apps/template/templates/default/css/listing.css" />
<script type="text/javascript" language="javascript" src="apps/template/templates/default/js/listing.js"></script>
	<?php
	}
	
	protected function center()
	{
		$theme_list = $this->get('theme_list');
		?>

		<table class="list-table">
		<thead>
		<tr>
			<th width="130">缩图图</th><th>名称/描述</th><th width="200">作者</th><th width="30">启用</th><th width="30">删除</th>
		</tr>
		</thead>
		
		<tbody id="row-list">
		<?php 
		foreach($theme_list as $theme)
		{
		?>
		<tr id="row-<?php echo $theme->id; ?>"  onMouseOver="this.className='row-on'" onMouseOut="this.className='row-off'">
		<td align="center">
			<div class="theme-thumbnail" title="<?php echo $theme->image; ?>">
				<img src="<?php echo $theme->thumbnail;?>" width="120" height="90">
			</div>
		</td>
		<td valign="top"><div class="theme-title"><?php echo $theme->name;?></div><?php echo $theme->description;?></td>
		<td>
			<?php
			echo '<strong>'.$theme->auther.'</strong><br /><p>'.$theme->auther_email.'<br />';
			if($theme->auther_website) echo '<a href="'.$theme->auther_website.'" target="_blank">'.$theme->auther_website.'</a>';
			echo '</p>';
			?>
		</td>
		<td align="center">
		<a href="javascript:;" onclick="javascript:makeDefault(<?php echo $theme->id; ?>)" id="star-<?php echo $theme->id; ?>" title="<?php echo  $theme->is_default?'已启用':'点击启用此主题'; ?>" class="<?php echo $theme->is_default?'star-on':'star-off'?>"></a>
		</td>
		<td align="center"><a href="javascript:;" onclick="javascript:deleteTheme(<?php echo $theme->id; ?>)" class="delete"></a></td>
		</tr>		
		<?php
		}
		?>
		</tbody>
		
		<tfoot>
		<tr>
			<td colspan="5"><div class="align-left">当前共安装了 <?php echo count($theme_list); ?> 个主题</div></td>
		</tr>
		</tfoot>
		</table>

		<?php
		
	}	

}
?>